# _*_ coding: UTF-8 _*_
# @Time     : 2021/10/22 上午 10:37
# @Author   : Li Jie
# @Site     : http://www.hzdledu.cn/
# @File     : c5s2_while循环语句.py
# @Software : PyCharm

# while循环
# 实现1-100的累加
a = 1  # 初始化语句
sum = 0
while a <= 100:  # 循环条件
    sum += a  # 循环体
    a += 1  # 迭代语句
    print(sum)

# 课堂练习
# 用while循环实现1-100的累乘,1x2x3x4x...x100=?
a = 1
sum = 1
while a <=100:
    sum *=a
    a +=1
print(sum)
